package com.dream.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
@Entity
@Table(name="sys_question")
public class Sys_Question extends AllId implements Serializable
{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Sys_TestPaper sys_TestPaper;//所在卷
	
	private Integer  completeTime;//完成时间
	
	private String type="0";//类型   0,主，1客
	
	private Long timeStundent;//学生完成时间
	
	private String timeStundent1;//完成的系统时间
	
	private String title; //题名
	
	private String content;//题的内容
	
	private Integer fen;
	private String answerTeacher;//题的老师答案
	 
	private String qtype="0";//题的类型  0文字 1链接 2视频，图片
	
	private String qaType="0";//答案的类型 0 文字 1链接 2视频，图片
	
	private List<Sys_User_Question> listsuq = null;//一个题也可以有多个用户
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_Question", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20) 
	public List<Sys_User_Question> getListsuq()
	{
		return listsuq;
	}

	public void setListsuq(List<Sys_User_Question> listsuq)
	{
		this.listsuq = listsuq;
	}


	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(CascadeType.PERSIST)
	public Sys_TestPaper getSys_TestPaper()
	{
		return sys_TestPaper;
	}

	public void setSys_TestPaper(Sys_TestPaper sys_TestPaper)
	{
		this.sys_TestPaper = sys_TestPaper;
	}

	public Integer getCompleteTime()
	{
		return completeTime;
	}

	public void setCompleteTime(Integer completeTime)
	{
		this.completeTime = completeTime;
	}

	public String getType()
	{
		return type;
	}

	public void setType(String type)
	{
		this.type = type;
	}

	public Long getTimeStundent()
	{
		return timeStundent;
	}

	public void setTimeStundent(Long timeStundent)
	{
		this.timeStundent = timeStundent;
	}

	public String getTimeStundent1()
	{
		return timeStundent1;
	}

	public void setTimeStundent1(String timeStundent1)
	{
		this.timeStundent1 = timeStundent1;
	}

	public String getTitle()
	{
		return title;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public String getAnswerTeacher()
	{
		return answerTeacher;
	}

	public void setAnswerTeacher(String answerTeacher)
	{
		this.answerTeacher = answerTeacher;
	}

	public String getQtype()
	{
		return qtype;
	}

	public void setQtype(String qtype)
	{
		this.qtype = qtype;
	}

	public String getQaType()
	{
		return qaType;
	}

	public void setQaType(String qaType)
	{
		this.qaType = qaType;
	}

	public Integer getFen() {
		return fen;
	}

	public void setFen(Integer fen) {
		this.fen = fen;
	}

	public Sys_Question(String table_id, Integer completeTime, String type, Long timeStundent, String timeStundent1, String title, String content, Integer fen, String answerTeacher, String qtype, String qaType,String daan) {
		super(table_id);
		this.completeTime = completeTime;
		this.type = type;
		this.timeStundent = timeStundent;
		this.timeStundent1 = timeStundent1;
		this.title = title;
		this.content = content;
		this.fen = fen;
		this.answerTeacher = answerTeacher;
		this.qtype = qtype;
		this.qaType = qaType;
		super.setString1(daan);
	}

	public Sys_Question() {
		
	}
	
	
	
	

}
